package cn.lanqiao.consumer.controller;

import cn.lanqiao.consumer.feign.ProviderFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RefreshScope
@RestController
public class ConsumerController {

    @Autowired
    ProviderFeign providerFeign;

    @Value("${server.port}")
    String port;

    @Value("${user.name}")
    String userName;

    @GetMapping("/hi-feign")
    public String hiFeign(){
        return providerFeign.hi(userName);
    }

}
